{extend name="admin@index_layout"/}
{block name="main"}
<div class="layui-card">
    <div class="layui-card-header">属性-{$flag}-内容列表</div>
    <div class="layui-card-body">
        <div class="layui-form">
            <table class="layui-hide" id="currentTable" lay-filter="currentTable"></table>
        </div>
    </div>
</div>

<script type="text/html" id="barTool">
    <a class="layui-btn layui-btn-xs" data-open='{:url("cms/edit")}?catid={{ d.catid }}&id={{ d.did }}' data-title="编辑内容" data-full="true">编辑</a>
    <a href='{:url("revoke",["outid"=>$flagId])}?catid={{ d.catid }}&did={{ d.did }}&id={{ d.id }}' class="layui-btn layui-btn-warm layui-btn-xs layui-tr-out">移除</a>
</script>



{/block}
{block name="script"}
<script>
    layui.use('yznTable', function() {
        var table = layui.yznTable;

        var init = {
            table_elem: '#currentTable',
            modify_url: '{:url("sort")}',
        };

        table.render({
            init: init,
            id: 'currentTable',
            elem: '#currentTable',
            toolbar: ['refresh',
                [{
                    html: '<a class="layui-btn layui-btn-sm" type="button" href="{:url("index")}"><i class="iconfont icon-undo"></i>&nbsp;返回</a>'
                }]
            ],
            url: '{:url("lists")}',
            url: '{:url("lists",["id"=>$flagId])}',
            search:true,
            cols: [
                [
                    { field: 'id', title: 'ID', width: 80, fixed: true, sort: true,align:"center"},
                    { field: 'listorder', width: 70, title: '排序', edit: 'text',search:false },
                    { field: 'title', title: '文章标题', searchOp: 'like'},
                    { field: 'catname', title: '所属栏目', width: 100, align: "center"},
                    { field: 'model', title: '所属模型', width: 100, align: "center"},
                    { field: 'url', width: 60, align: "center", title: 'URL', templet: yznTable.formatter.url, search: false },
                    { field: 'thumb', width: 100, title: '图片', search: false, templet: yznTable.formatter.image },
                    { field: 'create_time', width: 160, title: '创建时间', search: 'range'},
                    { fixed: 'right', width: 150, title: '操作', toolbar: '#barTool', align: "center" }
                ]
            ],
            page: {}
        });
    });
</script>
{/block}